package com.calm.editor.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.calm.editor.api.PageService;
import com.calm.editor.entity.Page;
import com.calm.editor.servlet.Event;

@Service("page")
@Transactional
public class PageServiceImpl extends BaseServiceImpl<Page, Integer> implements PageService {
	
	@Event("loadPage")
	public Page getById(Integer id) {
		return super.getById(id);
	}

	@Event("saveNode")
	public void update(Page page) {
//		Page byId = getById(page.getId());
//		byId.setTitle(page.getTitle());
//		byId.setElementId(page.getElementId());
		super.update(page);
	}

	@Override
	public Class<Page> getEntityClass() {
		return Page.class;
	}
}
